package com.ruoyi.labdata.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.ruoyi.labdata.domain.LabDeclarationFiling;
import com.ruoyi.labdata.domain.LabOrgnization;

/**
 * 机构Mapper接口
 * 
 * @author winner pan
 * @date 2022-02-02
 */
public interface LabOrgnizationMapper 
{
    /**
     * 查询机构
     * 
     * @param orgId 机构ID
     * @return 机构
     */
    public LabOrgnization selectLabOrgnizationById(Long orgId);

    /**
     * 查询机构列表
     * 
     * @param labOrgnization 机构
     * @return 机构集合
     */
    public List<LabOrgnization> selectLabOrgnizationList(LabOrgnization labOrgnization);

    /**
     * 新增机构
     * 
     * @param labOrgnization 机构
     * @return 结果
     */
    public int insertLabOrgnization(LabOrgnization labOrgnization);

    /**
     * 修改机构
     * 
     * @param labOrgnization 机构
     * @return 结果
     */
    public int updateLabOrgnization(LabOrgnization labOrgnization);

    /**
     * 删除机构
     * 
     * @param orgId 机构ID
     * @return 结果
     */
    public int deleteLabOrgnizationById(Long orgId);

    /**
     * 批量删除机构
     * 
     * @param orgIds 需要删除的数据ID
     * @return 结果
     */
    public int deleteLabOrgnizationByIds(Long[] orgIds);
    
   // public List<LabOrgnization> queryLabOrgnizationByName(String orgName);
    public List<LabOrgnization> queryUserThirdLabByName(@Param("orgName") String orgName, @Param("orgId") Long orgId);
    
    public List<LabOrgnization> getOrgByFunctionOpt(Long orgFunctionOpt);
    
    public List<LabOrgnization> listLabBySecondOrgId(Long orgId);
    
    public Integer checkOrgUsed(Long orgId);

    List<LabOrgnization> chooseOrgsQuery(LabOrgnization labOrgnization);
    
    List<LabOrgnization> getLabOrgnizationTreeList(LabOrgnization labOrgnization);
    
    List<LabOrgnization> listPlatformOrgTree();

    int updateLabOrgnizationInstanceId(LabDeclarationFiling labDeclarationFiling);

    int updateLabOrgnizationInstanceIdNull(Long orgId);

    List<LabOrgnization> listLabByOrgId(Long orgId);
}
